package com.ccs.demo.service;

import com.ccs.demo.mapper.UserMapper;
import com.ccs.demo.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    //校验用户名或密码是否正确
    public Boolean checkPassword(String username, String password) {
        UserInfo userInfo=userMapper.queryUserInfoByName(username);
        if(userInfo==null || userInfo.getId()<=0){
            return false;
        }

        return password.equals(userInfo.getPassWord());
    }
}
